package com.owen.he.jee.utils;

import java.io.Serializable;

import org.apache.commons.lang3.StringUtils;

import com.owen.he.jee.utils.excel.SimpleExcel;

/**
 * excel最小单元格属性，与SimpleExcel属性对应
 * @author owen.he
 *
 */
public class ExcelRelation implements Serializable{
	
	private static final long serialVersionUID = 3151430737820239802L;
	
	/** 名字，用于表示所属表头 */
	private String name;
	/** 对应数据库的字段 */
	private String field;
	/** 宽度，写入Excel时会×256  */
	private int width;
	/** 位置，用于排列表头顺序  */
	private int index;
	/** CELL_TYPE常量 */
	private int type;
	/** 单元格颜色值 */
    private String color;
    /** 是否必填  */
    private boolean required = false;
    /** 注释  */
    private String annotate;
    /** 对齐方式  */
    private String align;
    
    /** 是否作为导出处理，默认是导出 */
    private boolean isExport;
    /** 是否作为导入处理，默认是导入 */
    private boolean isImport;
    
	public ExcelRelation() {
		super();
	}
	public ExcelRelation(SimpleExcel simExcel, String fieldName) {
		this.name = simExcel.name();
		String fd = simExcel.field();
		this.field = StringUtils.isBlank(fd)?fieldName:fd;
		this.width = simExcel.width();
		this.index = simExcel.index();
		this.color = simExcel.color();
		this.type = simExcel.type();
		this.required = simExcel.required();
		this.annotate = simExcel.annotate();
		this.align = simExcel.align();
		this.isExport = simExcel.isExport();
		this.isImport = simExcel.isImport();
		
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getField() {
		return field;
	}
	public void setField(String field) {
		this.field = field;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getIndex() {
		return index;
	}
	public void setIndex(int index) {
		this.index = index;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public boolean isRequired() {
		return required;
	}
	public void setRequired(boolean required) {
		this.required = required;
	}
	public String getAnnotate() {
		return annotate;
	}
	public void setAnnotate(String annotate) {
		this.annotate = annotate;
	}
	public String getAlign() {
		return align;
	}
	public void setAlign(String align) {
		this.align = align;
	}
	public boolean isExport() {
		return isExport;
	}
	public void setExport(boolean isExport) {
		this.isExport = isExport;
	}
	public boolean isImport() {
		return isImport;
	}
	public void setImport(boolean isImport) {
		this.isImport = isImport;
	}
	
}
